from threading  import get_ident,Thread
import time 

storage = {}
class Local(object):
    storage = {}

    def set(self,k,v):
        ident = get_ident()
        if ident in storage:
            storage[ident][k] = v 
        else:
            storage[ident] = {k:v}

    def get(self,k):
        ident = get_ident()
        return storage


obj = Local()

def task(arg):
    obj.set('val',arg)
    v = obj.get('val')
    print(v)

for i in range(10):
    t = Thread(target=task,args=(i,))
    t.start()
